/**
 *   yatce
 *   Copyright (C) 2009  UENISHI Kota <kuenishi+yatce@gmail.com>
 *
 *     This program is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU Lesser General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU Lesser General Public License for more details.
 *
 *     You should have received a copy of the GNU Lesser General Public License
 *     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 **/
#ifndef TC_WRAPPER_H
#define TC_WRAPPER_H

#include <stdio.h>
#include <tcutil.h>
#include <tcadb.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>

#include <erl_driver.h>
#include "tc_table_operation.h"

void quit( TCADB * adb );

char * get_table_name(char * buff);

int tc_open(  TCADB * adb, const char * table_name_with_options, char ** rbuf );

int tc_put(   TCADB * adb, const ErlDrvBinary * key, const ErlDrvBinary * value, char ** rbuf, int command );

int tc_key_operation( int command, TCADB * adb, const ErlDrvBinary * key, char ** rbuf );

int tc_get(   TCADB * adb, const ErlDrvBinary * key, char ** rbuf );
int tc_out(   TCADB * adb, const ErlDrvBinary * key, char ** rbuf );
int tc_test(char ** rbuf);

#endif

